<?php
//GtkIconView example
$wnd = new GtkWindow();
$wnd->set_title('GtkIconView');
$wnd->set_default_size(400, 400);
$wnd->connect_simple('destroy', array('Gtk', 'main_quit'));
 
$iv = new GtkIconView();
 
$model = new GtkListStore(Gtk::TYPE_OBJECT, Gtk::TYPE_STRING);
$iv->set_model($model);
 
//fill the model with some nice icons
$ids = Gtk::stock_list_ids();

foreach ($ids as $id) {
	$model->set($model->append(), 0, GdkPixbuf::new_from_file("media/images/blank.png"), 1, 'icone');
}
 
$iv->set_pixbuf_column(0);
$iv->set_text_column(1);
 
//number of columns in view, not model
$iv->set_columns(0);
$iv->set_item_width(100);
 
//make it scrollable
$scrollwin = new GtkScrolledWindow();
$scrollwin->set_policy(
    Gtk::POLICY_AUTOMATIC,
    Gtk::POLICY_AUTOMATIC
);
$scrollwin->add($iv);
 
$wnd->add($scrollwin);
$wnd->show_all();
Gtk::main();
?>